<template>
  <div class="popup-container">
    <div class="header">
      <h1>
        <img src="" alt="Sytable" class="app-icon">
        Sytable
      </h1>
      <p>OCR + RPA自动填表工具</p>
      <div class="welcome-message">
        <p><span class="status-dot"></span> 运行中</p>
        <div class="action-buttons">
          <button @click="openOptions" class="btn-primary">说明文档</button>
          
        </div>
      </div>
    </div>
  </div>
</template>

<script setup lang="ts">
import { ref } from 'vue'

// 打开选项页面
const openOptions = () => {
  chrome.runtime.openOptionsPage()
}

// 打开帮助页面
const openHelp = () => {
  chrome.tabs.create({
    url: 'https://github.com/your-repo/sytable#readme'
  })
}
</script>

<style scoped>

.popup-container {
  width: 320px;
  min-height: 200px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #1081E1;
}

.header {
  text-align: center;
  padding: 30px 20px;
  color: white;
}

.header h1 {
  margin: 0 0 8px 0;
  font-size: 1.8em;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.app-icon {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.header p {
  margin: 0 0 20px 0;
  font-size: 0.9em;
  opacity: 0.9;
}

.welcome-message {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 20px;
  backdrop-filter: blur(10px);
}

.welcome-message p {
  margin: 8px 0 16px 0;
  font-size: 0.9em;
  line-height: 1.4;
  display: flex;
  align-items: center;
  justify-content: center;
}

.action-buttons {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 16px;
}

.btn-primary, .btn-secondary {
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  font-size: 0.85em;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 500;
}

.btn-primary {
  background: rgba(255, 255, 255, 0.9);
  color: #1081E1;
}

.btn-primary:hover {
  background: white;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}

.status-dot {
  width: 8px;
  height: 8px;
  background-color: #00ff88;
  border-radius: 50%;
  margin-right: 8px;
  box-shadow: 0 0 8px rgba(0, 255, 136, 0.6);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 8px rgba(0, 255, 136, 0.6);
  }
  50% {
    box-shadow: 0 0 16px rgba(0, 255, 136, 0.8);
  }
  100% {
    box-shadow: 0 0 8px rgba(0, 255, 136, 0.6);
  }
}
</style>
